<template>
  <div>用户名：<span @click="getNickName">{{ nickName }}</span></div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
  data() {
    return {

    }
  },
  created() {
    console.log(this.nickName)
  },
  computed: {
    ...mapGetters(['nickName'])
  },
  methods: {
    getData() {
      // this.$http.post(this.$services.domain.GET_USER_INFO).then(res => {
      //   const nickName = res.data.nickName
      //   return nickName
      // })
      return this.$http.post(this.$services.domain.GET_USER_INFO)
    },
    async getNickName() {
      const nickName = await this.getData()
      console.log(nickName)
    }
  }
}
</script>
